﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Bulletin_Manage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    public void PopulateGongGao()
    {
        lvGongGaoList.DataSource = Bulletin.GetAllByConditon(txtGuanJianZi.Text, txtTimeFrom.Text, txtTimeTo.Text, (int)Bulletin.type.前台, 0, 0);
        lvGongGaoList.DataBind();
    }
    protected void btnSouSuo_Click(object sender, EventArgs e)
    {
        PopulateGongGao();
    }
    protected void lvGongGaoList_ItemDeleting(object sender, ListViewDeleteEventArgs e)
    {

        int GongGaoID = DongDong.Common.Misc.ConvertToInt(lvGongGaoList.DataKeys[e.ItemIndex].Value);
        Bulletin.Delete(GongGaoID);
        PopulateGongGao();

    }
    protected void lvGongGaoList_PagePropertiesChanged(object sender, EventArgs e)
    {
        PopulateGongGao();
    }
    protected void Pager_PreRender(object sender, EventArgs e)
    {
        if (lvGongGaoList.Items.Count == 0)
            PopulateGongGao();
    }

}